home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 1744 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.2 KB

  1. Path: news.iastate.edu!usenet
  2. From: Steve Lee <sjlee@iastate.edu>
  3. Newsgroups: comp.lang.c++,comp.lang.c
  4. Subject: Performance: C vs. C++
  5. Date: Fri, 12 Jan 1996 11:46:52 -0800
  6. Organization: Iowa State University
  7. Message-ID: <30F6BAAC.12B5@iastate.edu>
  8. NNTP-Posting-Host: dial22.ppp.iastate.edu
  9. Mime-Version: 1.0
  10. Content-Type: text/plain; charset=us-ascii
  11. Content-Transfer-Encoding: 7bit
  12. X-Mailer: Mozilla 2.0b4a (Win16; I)
  13.  
  14. Hi,
  15.  
  16. I was wondering if anyone could tell me what the difference in performance would be between 
  17. writing a program in C++ vs. C.  Assume that the compilers are both of equal quality.  I know 
  18. that certain features such as virtual functions and exception handling add overhead.  Are there 
  19. any others?  If you don't implement these features that add the extra overhead, is C++ directly 
  20. comparable to C in performance then?  The only other reason I could see C++ being slower than C 
  21. is programming style.  Object-oriented is slower since there are more layers, hence function call 
  22. overhead.
  23.  
  24. Anyone with some answers, disagreements?  Thanks.
  25.  
  26. -- 
  27. Steve Lee
  28. Computer Engineering/Computer Science
  29. Iowa State University
  30. email -> sjlee@iastate.edu
  31. WWW   -> http://www.cs.iastate.edu/~sjlee/homepage.html
  32.